package com.ecut.xzh.mapper;

import com.ecut.xzh.entity.Market;
import com.ecut.xzh.vo.MarketVO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author XZH
 */
@Mapper
public interface MarketMapper {

    /**
     * 新增商品
     * @param market
     */
    @Insert("insert into market (name, image, student_id) values (#{name}, #{image}, #{studentId})")
    void insert(Market market);

    /**
     * 滚动查询
     * @param scrollNum
     * @param i
     * @return
     */
    @Select("select * from market")
    Page<MarketVO> scroll(Integer scrollNum, int i);
}
